package com.varbal.icegame.bean;

//import javax.persistence.*;
import java.util.Objects;

/**
 * Equals实体类
 * 测试使用equals方法时，hashcode方法的作用
 * 测试new新对象时，hashcode的作用
 */
public class Equals {

	private Integer ids;

	private String name;

	private String id;


	public Equals(String name, String id) {
		super();
		this.name = name;
		this.id = id;
	}

	public Equals() {
		super();
	}

	public Equals(Integer ids , String name, String id) {
		super();
		this.name = name;
		this.id = id;
		this.ids=ids;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		Equals equals = (Equals) o;
		return ids == equals.ids &&
				Objects.equals(name, equals.name) &&
				Objects.equals(id, equals.id);
	}

	@Override
	public int hashCode() {
		return Objects.hash(ids, name, id);
	}

	public Integer getIds() {
		return ids;
	}

	public void setIds(Integer ids) {
		this.ids = ids;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "Equals [name=" + name + ", id=" + id + "]";
	}


}
